package sxh.test.job;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class DoJobExec {
	
	//@Scheduled(cron="50 19 22 * * ?") //固定点
	@Scheduled(fixedRate = 3000) //每个多长时间
	//@Scheduled(fixedDelay = 3000) //开机启动
	 public void job() {  
	        System.out.println("执行定时任务");   
	    }
	@RequestMapping(value="aa")
	public String job1() {  
        System.out.println("执行定时任务");
        return "hello";
    }  
}
